package protobuf {
	import com.netease.protobuf.*;
	use namespace com.netease.protobuf.used_by_generated_code;
	import com.netease.protobuf.fieldDescriptors.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IDataOutput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	import flash.utils.ByteArray;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public dynamic final class CLIENT_SESSION_CERT extends com.netease.protobuf.Message {
		/**
		 *  @private
		 */
		public static const IP:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.CLIENT_SESSION_CERT.ip", "ip", (2 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		public var ip:flash.utils.ByteArray;

		/**
		 *  @private
		 */
		public static const TIMESTAMP:FieldDescriptor$TYPE_UINT64 = new FieldDescriptor$TYPE_UINT64("protobuf.CLIENT_SESSION_CERT.timestamp", "timestamp", (3 << 3) | com.netease.protobuf.WireType.VARINT);

		public var timestamp:UInt64;

		/**
		 *  @private
		 */
		public static const TIMEOUT:FieldDescriptor$TYPE_UINT32 = new FieldDescriptor$TYPE_UINT32("protobuf.CLIENT_SESSION_CERT.timeout", "timeout", (4 << 3) | com.netease.protobuf.WireType.VARINT);

		public var timeout:uint;

		/**
		 *  @private
		 */
		public static const PUBLIC_KEY_SIGNATURE:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.CLIENT_SESSION_CERT.public_key_signature", "publicKeySignature", (5 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		public var publicKeySignature:flash.utils.ByteArray;

		/**
		 *  @private
		 */
		public static const PUBLIC_KEY:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.CLIENT_SESSION_CERT.public_key", "publicKey", (6 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		private var public_key$field:flash.utils.ByteArray;

		public function clearPublicKey():void {
			public_key$field = null;
		}

		public function get hasPublicKey():Boolean {
			return public_key$field != null;
		}

		public function set publicKey(value:flash.utils.ByteArray):void {
			public_key$field = value;
		}

		public function get publicKey():flash.utils.ByteArray {
			return public_key$field;
		}

		/**
		 *  @private
		 */
		public static const USERID:FieldDescriptor$TYPE_UINT64 = new FieldDescriptor$TYPE_UINT64("protobuf.CLIENT_SESSION_CERT.userid", "userid", (7 << 3) | com.netease.protobuf.WireType.VARINT);

		public var userid:UInt64;

		/**
		 *  @private
		 */
		public static const USERNAME:FieldDescriptor$TYPE_BYTES = new FieldDescriptor$TYPE_BYTES("protobuf.CLIENT_SESSION_CERT.username", "username", (8 << 3) | com.netease.protobuf.WireType.LENGTH_DELIMITED);

		public var username:flash.utils.ByteArray;

		/**
		 *  @private
		 */
		override used_by_generated_code final function writeToBuffer(output:com.netease.protobuf.WritingBuffer):void {
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 2);
			com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, this.ip);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 3);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT64(output, this.timestamp);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 4);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT32(output, this.timeout);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 5);
			com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, this.publicKeySignature);
			if (hasPublicKey) {
				com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 6);
				com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, public_key$field);
			}
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.VARINT, 7);
			com.netease.protobuf.WriteUtils.write$TYPE_UINT64(output, this.userid);
			com.netease.protobuf.WriteUtils.writeTag(output, com.netease.protobuf.WireType.LENGTH_DELIMITED, 8);
			com.netease.protobuf.WriteUtils.write$TYPE_BYTES(output, this.username);
			for (var fieldKey:* in this) {
				super.writeUnknown(output, fieldKey);
			}
		}

		/**
		 *  @private
		 */
		override used_by_generated_code final function readFromSlice(input:flash.utils.IDataInput, bytesAfterSlice:uint):void {
			var ip$count:uint = 0;
			var timestamp$count:uint = 0;
			var timeout$count:uint = 0;
			var public_key_signature$count:uint = 0;
			var public_key$count:uint = 0;
			var userid$count:uint = 0;
			var username$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
				switch (tag >> 3) {
				case 2:
					if (ip$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.ip cannot be set twice.');
					}
					++ip$count;
					this.ip = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				case 3:
					if (timestamp$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.timestamp cannot be set twice.');
					}
					++timestamp$count;
					this.timestamp = com.netease.protobuf.ReadUtils.read$TYPE_UINT64(input);
					break;
				case 4:
					if (timeout$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.timeout cannot be set twice.');
					}
					++timeout$count;
					this.timeout = com.netease.protobuf.ReadUtils.read$TYPE_UINT32(input);
					break;
				case 5:
					if (public_key_signature$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.publicKeySignature cannot be set twice.');
					}
					++public_key_signature$count;
					this.publicKeySignature = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				case 6:
					if (public_key$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.publicKey cannot be set twice.');
					}
					++public_key$count;
					this.publicKey = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				case 7:
					if (userid$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.userid cannot be set twice.');
					}
					++userid$count;
					this.userid = com.netease.protobuf.ReadUtils.read$TYPE_UINT64(input);
					break;
				case 8:
					if (username$count != 0) {
						throw new flash.errors.IOError('Bad data format: CLIENT_SESSION_CERT.username cannot be set twice.');
					}
					++username$count;
					this.username = com.netease.protobuf.ReadUtils.read$TYPE_BYTES(input);
					break;
				default:
					super.readUnknown(input, tag);
					break;
				}
			}
		}

	}
}
